package com.shuaitao.newsystem.handler;

import com.sun.org.apache.bcel.internal.generic.NEW;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.DisabledException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(DisabledException.class)
    public ResponseEntity<String> handleMyCustomException(DisabledException ex) {

        return ResponseEntity.status(200).body("认证已过期，请重新登陆");
    }
}
